Skip to content

Skip interactive setup wizard in non-TTY environments#353

Merged
jeremy merged 2 commits intomainfrom
non-interactive-install
Mar 24, 2026
Merged

Skip interactive setup wizard in non-TTY environments#353
jeremy merged 2 commits intomainfrom
non-interactive-install

Conversation

@robzolkos
Copy link
Collaborator

@robzolkos robzolkos commented Mar 23, 2026

When someone asks Claude Code to install the Basecamp CLI via curl -fsSL https://basecamp.com/install-cli | bash, the install script hangs — it unconditionally runs basecamp setup at the end, which launches an interactive wizard with TUI pickers, browser OAuth, and confirmation prompts that can't work without a terminal.

Ref: https://3.basecamp.com/2914079/buckets/46292715/card_tables/cards/9706904758

Changes

scripts/install.sh

  • Detect non-TTY (stdin/stdout not a terminal) and skip the interactive wizard
  • Run basecamp setup claude non-interactively instead, which installs the agent skill + Claude plugin + marketplace registration without prompts
  • Add BASECAMP_SKIP_SETUP=1 env var for explicit opt-out even when a TTY is present
  • Print next-step instructions pointing to basecamp auth login

install.md

  • Document the non-interactive detection and BASECAMP_SKIP_SETUP env var

How it works

The install script already had TTY detection for the banner animation. This extends that pattern to the setup step:

Condition Behavior
BASECAMP_SKIP_SETUP=1 Skip wizard, run basecamp setup claude non-interactively
stdin AND stdout are TTY Run basecamp setup wizard (unchanged)
No TTY (Claude Code, CI, pipes) Skip wizard, run basecamp setup claude non-interactively

After the install script finishes in a non-TTY environment, Claude Code has:

  • ✅ Binary installed and on PATH
  • ✅ Agent skill at ~/.agents/skills/basecamp/SKILL.md
  • ✅ Symlink at ~/.claude/skills/basecamp
  • ✅ Claude plugin and marketplace registered
  • ❌ Auth — user still needs to run basecamp auth login in a terminal

Testing

# Simulates the Claude Code environment (no TTY on either end)
echo "" | bash scripts/install.sh 2>&1

# Explicit skip with TTY present
BASECAMP_SKIP_SETUP=1 bash scripts/install.sh

# Normal TTY — unchanged behavior
bash scripts/install.sh

Future consideration: OAuth within coding agents

The one remaining manual step is basecamp auth login, which requires a terminal because the OAuth flow either opens a browser (local mode) or blocks on stdin waiting for a pasted callback URL (remote mode). Neither works inside a coding agent's bash tool.

A potential improvement would be splitting the remote auth flow into two non-interactive commands:

# 1. Generate auth URL + PKCE state (prints URL, saves state, exits)
basecamp auth login --auth-url-only
# → https://launchpad.37signals.com/authorization/new?client_id=...&state=abc123

# 2. User authenticates in browser, gets redirected to callback URL
#    (page shows connection error — that's expected)

# 3. Complete the token exchange with the callback URL
basecamp auth callback "http://127.0.0.1:8976/callback?code=XYZ&state=abc123"

This would let a coding agent orchestrate the flow conversationally — show the URL, ask the user to paste the callback URL back in chat, then finish the exchange. Today this isn't possible because --remote bundles both steps into a single blocking process.

Not in scope for this PR, but worth considering as agent-driven installs become more common.

When the install script runs without a terminal (e.g. from Claude Code,
CI, or piped input), the interactive setup wizard hangs on TUI prompts.

Detect non-TTY and run `basecamp setup claude` non-interactively instead,
which installs the agent skill, Claude plugin, and marketplace registration
without prompts. Auth remains the only manual step.

Also adds BASECAMP_SKIP_SETUP=1 env var for explicit opt-out when a TTY
is present.
Copilot AI review requested due to automatic review settings March 23, 2026 13:03
@github-actions github-actions bot added docs enhancement New feature or request labels Mar 23, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automatic detection of non-interactive environments to the Basecamp CLI install script, preventing the script from hanging when run via piped input (e.g., in Claude Code). It implements conditional logic that skips the interactive setup wizard in non-TTY environments or when explicitly skipped via the BASECAMP_SKIP_SETUP=1 environment variable, while maintaining unchanged behavior for normal terminal installations.

Changes:

  • Add TTY detection to conditionally skip interactive setup wizard based on terminal availability
  • Introduce BASECAMP_SKIP_SETUP environment variable for explicit opt-out
  • Run non-interactive basecamp setup claude command in non-TTY environments
  • Provide next-step instructions pointing to basecamp auth login for manual authentication
  • Document the auto-detection behavior and environment variable in install.md

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/install.sh Implement conditional setup logic with TTY detection and environment variable support
install.md Document non-interactive detection and BASECAMP_SKIP_SETUP environment variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/install.sh">

<violation number="1" location="scripts/install.sh:339">
P2: Don’t suppress and ignore failures from `basecamp setup claude`. If this command fails, users will be told install succeeded even though the skill/plugin setup didn’t run, and there’s no stderr to diagnose it.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Remove 2>/dev/null so failures from 'basecamp setup claude' are visible
and diagnosable. Keep || true since the agent setup is best-effort — the
binary install already succeeded at this point.
@robzolkos robzolkos marked this pull request as ready for review March 23, 2026 13:13
Copilot AI review requested due to automatic review settings March 23, 2026 13:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@robzolkos robzolkos requested a review from jeremy March 23, 2026 13:16
@jeremy jeremy merged commit d809f43 into main Mar 24, 2026
31 checks passed
@jeremy jeremy deleted the non-interactive-install branch March 24, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants